// import { createApp } from "vue";
// import VueRouter from "vue-router";
// import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
// createApp.use(VueRouter);
// const routes: Array<RouteRecordRaw> = [
//   {
//     path: "/",
//     name: "refund",
//     component: () => import("@/views/refund.vue"),
//   },
//   {
//     path: "/",
//     name: "/refund",
//     component: () => import("@/views/refund.vue"),
//   },
//   {
//     path: "/",
//     name: "success",
//     component: () => import("@/views/success.vue"),
//   },
// ];

// const router = createRouter({
//   history: createWebHashHistory(),
//   routes,
// });

// export default router;

import { createRouter, createWebHashHistory } from "vue-router";
import { staticRoutes } from "./route";

const router = createRouter({
  history: createWebHashHistory(),
  routes: staticRoutes,
  // 滚动行为：当路由组件切换时滚动条的位置
  scrollBehavior() {
    return { top: 0, left: 0 };
  },
});
router.afterEach((to) => {
  document.title = to.meta.title as string;
});
// 导出路由
export default router;
